package com.zb.Service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.zb.Service.PowerService;
import com.zb.entity.Power;
import com.zb.mapper.PowerMapper;
@Component("PowerService")
public class PowerServiceImpl implements PowerService{
	@Autowired
	private PowerMapper pm;

	public List<Power> findPowerAll() {
		
		return pm.findPowerAll();
	}

	public void updatePower(Power p) {
		pm.updatePower(p);
		
	}

	public Power getPowerByid(int id) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", id);
		return pm.getPowerByid(params);
	}

	public Power getPowerByRoleId(int roleId) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("role_id", roleId);
		return pm.getPowerByRoleId(params);
	}

	
}